using System;
using System.Reflection.Emit;
using Pine.SourceParser.Tree;

namespace Pine.CodeGen
{
	public static class ReturnStatementCodeGenerator
	{
		public static void GenerateBytecode(Context ctx, Statement stmt)
		{
			ReturnStatement ret = (ReturnStatement) stmt;
			
			if (ret.rl != null)
				CodeGenerator.ParseRightList(ctx, ret.rl);
			
			ctx.il.Emit(OpCodes.Ret);
		}
	}
}

